﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
    CodeBehind="Details.aspx.cs" Inherits="MVCClubSite.Web.Views.Events.Details" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="contentblock">
        <h2>
            <%= Html.Encode(ViewData.Model.Event.Title) %>
        </h2>
        <h3>
            <%= ViewData.Model.Event.StartDateTime.ToString("MMMM d, yyyy hh:mm tt") %>
            <% if (ViewData.Model.Event.EndDateTime != null)
               { %>
            <% if (ViewData.Model.Event.StartDateTime.Date.Equals(ViewData.Model.Event.EndDateTime.Date))
                   Response.Write(" - " + ViewData.Model.Event.EndDateTime.ToShortTimeString());
               else
                   Response.Write(" - " + ViewData.Model.Event.EndDateTime.ToString("MMMM d yyyy hh:mm"));  %>
            <% } %>
        </h3>
        <p>
            <%= ViewData.Model.Event.Description %></p>
        <% if (ViewData.Model.Locations.Count > 0)
           { %>
       
        <div class="location">
         <h3>
            <%= ViewData.Model.Locations[0].Title %></h3>
            <p>
                <%= ViewData.Model.Locations[0].Description%></p>
            <p>
                <%= ViewData.Model.Locations[0].Address%></p>
            <br />

            
        </div>
        <%} %>
                    <% if (User.IsInRole("Administrator"))
               { %>
            <%= Html.ActionLink("Edit Event", "Edit", "Events", new { id = ViewData.Model.Event.ID }, null)%>
                    <%} %>
        </div>
</asp:Content>
